﻿using Util.Domain.Entities;
using Util.Domain.Repositories;

namespace Util.Data.EntityFrameworkCore; 

/// <summary>
/// 仓储基类
/// </summary>
/// <typeparam name="TEntity">实体类型</typeparam>
public abstract class RepositoryBase<TEntity> : RepositoryBase<TEntity, Guid>, IRepository<TEntity>
    where TEntity : class, IAggregateRoot<Guid> {
    /// <summary>
    /// 初始化仓储
    /// </summary>
    /// <param name="unitOfWork">工作单元</param>
    protected RepositoryBase( IUnitOfWork unitOfWork )
        : base( unitOfWork ) {
    }
}

/// <summary>
/// 仓储基类
/// </summary>
/// <typeparam name="TEntity">实体类型</typeparam>
/// <typeparam name="TKey">实体标识类型</typeparam>
public abstract class RepositoryBase<TEntity, TKey> : StoreBase<TEntity, TKey>, IRepository<TEntity, TKey> where TEntity : class, IAggregateRoot<TKey> {
    /// <summary>
    /// 初始化仓储
    /// </summary>
    /// <param name="unitOfWork">工作单元</param>
    protected RepositoryBase( IUnitOfWork unitOfWork ) : base( unitOfWork ) {
    }
}